package com.example;

import com.example.springfunction.ConfigDemoBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication

public class SpringfunctionApplication {


    public static void main(String[] args) {
        long startTime = System.currentTimeMillis();   //获取开始时间

        SpringApplication.run(SpringfunctionApplication.class, args);
        long endTime = System.currentTimeMillis(); //获取结束时间

        System.out.println("程序运行时间： " + (endTime - startTime) + "ms");
    }
    @Bean
    public ConfigDemoBean configDemoBean(){
        System.out.println("configDemoBean   RestTemplateController 开始工作.....");
        return new ConfigDemoBean();
    }

    @Bean
    public RestTemplate restTemplate() {
        System.out.println("restTemplate开始工作.....");
        return new RestTemplate();
    }

}
